import http from "./http";

const login = (email, password) => {
  const path = "/auth/login";
  return http.post(path, { email, password });
};

const resetPwd = (oldPwd, newPwd1, newPwd2) => {
  const path = "/auth/resetpwd";
  return http.post(path, { oldPwd, newPwd1, newPwd2 });
};

const getCaptcha = () => {
  const path = "/auth/captcha";
  return http.get(path);
};

const verifyCaptcha = (captcha_key, captcha_response) => {
  const path = "/auth/captcha";
  return http.post(path, {captcha_key, captcha_response});
};

export default { login, resetPwd, getCaptcha, verifyCaptcha };
